﻿using SqlSugar;

namespace JunionRobotTaskManager.Models
{
    /// <summary>
    /// 对接口
    /// </summary>
    public class TransferPort
    {

        /// <summary>
        /// 料口编号
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public string Id { get; set; }

        /// <summary>
        /// 料口名称
        /// </summary>
        public string PortName { get; set; }

        /// <summary>
        /// X轴坐标
        /// </summary>
        public float XPosition { get; set; }

        /// <summary>
        /// Y轴坐标
        /// </summary>
        public float YPosition { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enable { get; set; } = true;

        /// <summary>
        /// 位置编号
        /// </summary>
        public string LocationNumber { get; set; }

        /// <summary>
        /// 所在区域
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Region { get; set; }

        /// <summary>
        /// 所在楼层
        /// </summary>
        public int Floor { get; set; }

        #region 重写Equal
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }
            if (ReferenceEquals(obj, this))
            {
                return true;
            }

            return obj is TransferPort b && Id == (obj as TransferPort).Id;
        }

        public override int GetHashCode()
        {
            return this.Id.GetHashCode();
        }
        #endregion
    }
}
